//
//  ChatMessage.swift
//  TestIos
//
//  Created by 李亚东 on 2025/11/4.
//  Copyright © 2025 Liyadong. All rights reserved.
//

import UIKit

enum MessageType {
    case user
    case assistant
}

struct ChatMessage {
    let id: String
    let type: MessageType
    var content: String  // 改为 var，允许更新内容
    let timestamp: Date
    var isLoading: Bool  // 是否正在加载（显示loading状态）
    
    init(type: MessageType, content: String, isLoading: Bool = false) {
        self.id = UUID().uuidString
        self.type = type
        self.content = content
        self.timestamp = Date()
        self.isLoading = isLoading
    }
}

